-#
-# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
-# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
-# Created By:
-# Maintained By:
-#
-extends 'layouts/_widget_box.haml'

-block widget_help
  business_objects

-block widget_id
  business_objects_widget

-block widget_class
  business

-block widget_title
  Assets / Business Objects

-block widget_buttons
  .filter
    .row-fluid
      .span8
        %input.ui-corner-all.widgetsearch.clear-value{type : 'text', placeholder : 'Search'}
      .span4
        %a.btn.btn-add.pull-right{ 'href': 'javascript://', 'data-toggle': 'modal-ajax-form', 'data-modal-reset': 'reset', 'data-form-target': 'refresh', 'data-modal-class': 'modal-wide', 'data-object-singular': 'System', 'data-object-plural': 'systems' } 
          %i.grcicon-add
          %span.object-type System

-set quick_result_business_objects = quick_result_business_objects if quick_result_business_objects else None
-set prefix = "qf" if quick_result_business_objects else "dash"
-set tabbable_id = "" if quick_result_business_objects is defined else "quick_find_business_objects" 

-from 'shared/_quick_find.haml' import tab

-block main
  .tabbable.tabs-left{ 'id' : "#{tabbable_id}" }
    %ul.nav.nav-tabs
      =tab("Process", "Processes", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")
      =tab("System", "Systems", "/search?s=&qr={0}".format(quick_result_business_objects), "active", "business")
      =tab("Org Group", "Org Groups", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")
      =tab("Project", "Projects", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")
      =tab("Facility", "Facilities", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")
      =tab("Product", "Products", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")
      =tab("Data Asset", "Data Assets", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")
      =tab("Market", "Markets", "/search?s=&qr={0}".format(quick_result_business_objects), "", "business")

    .tab-content
      .tab-pane{ 'id' : "#{prefix}_processes" }
      .tab-pane{ 'id' : "#{prefix}_systems" }
      .tab-pane{ 'id' : "#{prefix}_org_groups" }
      .tab-pane{ 'id' : "#{prefix}_projects" }
      .tab-pane{ 'id' : "#{prefix}_facilities" }
      .tab-pane{ 'id' : "#{prefix}_products" }
      .tab-pane{ 'id' : "#{prefix}_data_assets" }
      .tab-pane{ 'id' : "#{prefix}_markets" }
